import java.util.*;

/**
 * @author LKQ
 * @date 2022/5/28 20:25
 * @description 滑动窗口
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.maxVowels("weallloveyou", 7);
    }
    public int maxVowels(String s, int k) {
        char[] S = s.toCharArray();
        int n = S.length;
        int ans = 0, cnt = 0;
        for (int i = 0; i < k; i++) {
            if (is(S[i])) {
                cnt++;
            }
        }
        ans = cnt;
        for (int i = k, l = 0; i < n; i++) {
            if (is(S[i])) {
                cnt++;
            }
            if (is(S[l])) {
                cnt--;
            }
            l++;
            ans = Math.max(ans, cnt);
        }
        return ans;
    }

    public boolean is(char c) {
        return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
    }
}
